import React from 'react';
import { Layout } from 'antd';
import Header from '@/components/Header/header';
import { cleanupStorage } from '@/utils/cleanupStorage';
import './global.less';

const { Content } = Layout;

// 应用启动时清理localStorage中的错误数据
cleanupStorage();

// 全局初始化数据配置
export async function getInitialState(): Promise<{ name: string; isLogin: boolean }> {
  const account = localStorage.getItem('account');
  return {
    name: account || '@umijs/max',
    isLogin: !!account
  };
}